const defaultData = () => ({
  type: "bar",
});

export const dataOptions = (data) => {
  return data.map((item) => {
    const { color, ...resData } = item;
    const config = defaultData();
    if (color) {
      resData.itemStyle = {
        color,
      };
    }
    return {
      ...config,
      ...resData,
    };
  });
};
